function* helloWorldGenerator() {
  console.log("123" + (yield 333));
  yield setTimeout(() => {
    console.log("我是异步");
  }, 1000);
  //   console.log(2222);
  yield console.log(1111111);
  yield "world";
  return "ending";
}
var hw = helloWorldGenerator();
hw.next();
hw.next();

var myIterable = {};
myIterable[Symbol.iterator] = function* () {
  yield 1;
  yield 2;
  yield 3;
};

console.log(...myIterable);
function* gen() {
  // some code
}

var g = gen();

console.log(g[Symbol.iterator]() === g);
console.dir(gen[Symbol.iterator]);
